
#import "FAMHomeGoalsViewController.h"

@interface FAMHomeGoalsViewController ()
@property (weak, nonatomic) IBOutlet UILabel *FAMWeightLabel;
@property (weak, nonatomic) IBOutlet UILabel *FAMGoalsLabel;

@end

@implementation FAMHomeGoalsViewController
- (void)viewWillAppear:(BOOL)animated{
    [super viewWillAppear:animated];
    if ([[FAMUserManger shareInstance].userModel.target_type isEqualToString:@"1"]) {
        self.FAMGoalsLabel.text = @"Lose weight";
    }else if ([[FAMUserManger shareInstance].userModel.target_type isEqualToString:@"2"]){
        self.FAMGoalsLabel.text = @"Gain weight";
    }else{
        self.FAMGoalsLabel.text = @"Maintain weight";
    }
}
- (void)viewDidLoad {
    [super viewDidLoad];
    [self FAM_showUi];
}
- (void)FAM_showUi{
    self.title = @"Goals";
    self.FAMWeightLabel.text = [NSString stringWithFormat:@"%@kg",[FAMUserManger shareInstance].userModel.weight];
    
}
- (IBAction)FAM_currentWeightButtonClick:(UITapGestureRecognizer *)sender {
    FAMHomeGoalsView *homeGoalsView = [[FAMHomeGoalsView alloc]initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH,SCREEN_HEIGHT )];
    WeakSelf(self);
    homeGoalsView.block = ^(NSString * _Nonnull weight) {
        weakSelf.FAMWeightLabel.text =[NSString stringWithFormat:@"%@kg",weight];
    };
    [self.view addSubview:homeGoalsView];
}
- (IBAction)FAM_weightGoalsButtonClick:(UITapGestureRecognizer *)sender {
    [self.navigationController pushViewController:[FAMMinGoalViewController new] animated:YES];
}


@end
